export const time = obj => {
  let nowDate = new Date(obj);
  let year = nowDate.getFullYear();
  //月份要加1才是当前月份，所有的月日时分秒如果时个位数都要在前面加0。
  let month = nowDate.getMonth() + 1 < 10 ? '0' + (nowDate.getMonth() + 1) : nowDate.getMonth() + 1;
  let date = nowDate.getDate() < 10 ? '0' + nowDate.getDate() : nowDate.getDate();
  // let hour = nowDate.getHours()< 10 ? "0" + nowDate.getHours() : nowDate.getHours();
  // let minute = nowDate.getMinutes()< 10 ? "0" + nowDate.getMinutes() : nowDate.getMinutes();
  // let second = nowDate.getSeconds()< 10 ? "0" + nowDate.getSeconds() : nowDate.getSeconds();
  return year + '-' + month + '-' + date + ' ';
};
